/************web服务器 app.js***********/
//引入模块
const express = require('express')
//引入用户管理路由器模块
const userRouter = require('./router/manage/user.js')
//引入商家管理路由模块
const shopRouter = require('./router/manage/shop.js')
//引入商品管理路由模块
const commodityRouter = require('./router/manage/commodity.js')
//引入评论管理路由器模块
const reviewRouter = require('./router/manage/review.js')

const pro = require('./router/pro.js');
const email = require('./router/components/email.js');
const cors = require('cors');
const upload = require('./router/components/upload.js');
const user = require('./router/components/user.js');
const finish = require('./router/components/finishorder.js');
const app = express();
app.listen(8000, () => {
    console.log('逛淘吧服务器启动成功，端口号：'+ '8000');
})
app.use(cors());
app.use(express.json())
app.use(express.urlencoded({ extended: false }))
app.use('/stroll', pro, upload, email, user, finish);
//用户管理
app.use('/user', userRouter)
//商家管理
app.use('/shop', shopRouter)
//商品管理
app.use('/commodity', commodityRouter)
//评论管理
app.use('/review', reviewRouter)
